
<div class="fadeIn">
    <br>
    <ol class="breadcrumb">
        <li class="active"><span class="glyphicon glyphicon-home" style="color:#23527c"></span>&nbsp;<mainpage></mainpage></li>
        <li class="active">系统管理 / 组织管理</li>
    </ol>
    <form class="form-inline">
        <div class="marT15 marB15 clearfix">
            <div class="input-group line1 left">
                <span class="input-group-addon" style='border:none'>单位列表:</span>
                <a type="button" class="btn btn-sm btn-primary" data-toggle="modal"  data-target=".bs-example-moda" ng-click="editTr('单位创建')">单位创建</a>
            </div>
        </div>
    </form>

  <div class="table-box">

    <table class="table table-bordered table-striped text-center bg-info">
        <thead >
        <tr class="info">
            <th class="text-center">序号</th>
            <th class="text-center">单位ID</th>
            <th class="text-center">单位名称</th>
            <th class="text-center">等级</th>
            <th class="text-center">上级单位名称</th>
            <th class="text-center">单位说明</th>
            <th class="text-center">操作</th>


        </tr>
        </thead>
        <tbody>
        <tr ng-repeat="item in result">
            <td>{{$index+1}}</td>
            <td class="w70">{{item.deptId}}</td>
            <td class="w85">{{item.deptName}}</td>
            <td>{{item.deptLevelName}}</td>
            <td class="w115">{{item.parentName}}</td>
            <td style="min-width: 200px; word-break: break-all;">{{item.remark}}</td>
            <td style="min-width: 180px;">
                <a class="marR10"  data-toggle="modal"  data-target=".bs-example-moda" ng-click="editTr('单位修改',item.deptId)">修改</a>
                <a class="marR10" data-toggle="modal"  data-target="#she"  ng-click="revise(item.deptId)">设置业务端</a>
                <a class="marR10" data-toggle="modal" data-target="#delete" ng-click='delete(item.deptId,$index)'>删除</a></td>
        </tr>
        <tr>
            <td><a class="glyphicon glyphicon-plus"  data-toggle="modal"  data-target=".bs-example-moda" ng-click="editTr('单位创建')"></a></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
        </tr>
        </tbody>
    </table>
  </div>

    <page></page>
</div>

<div class="modal fade " id="she" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
    <div class="modal-dialog " role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" >请选择业务端</h4>
            </div>
            <div class="modal-body bg-info">
                <form class="form-inline">
                    <div class="row">
                        <label class="checkbox-inline col-md-3" style="margin-left: 25px" ng-repeat="timr in listData">
                            <input type="checkbox" id="inlineCheckbox1" class="svr" value={{timr.SVR_NODE}} >{{timr.SVR_NODE_NAME}}
                        </label>
                    </div>
                </form>
                <br>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-primary" ng-click="keep()" >保存</button>
            </div>


        </div>
    </div>
</div>


<div class="modal fade bs-example-moda" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
<div class="modal-dialog " role="document" style="width: 600px">
<div class="modal-content">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">{{popup}}</h4>
    </div>
    <div class="modal-body">
                <div class="row">
                    <div class='col-xs-6 lineH25'>
                        <label class="left">单位ID:</label>
                        <input type="text" class="form-control line4 right id" placeholder="" ng-show="popup=='单位创建'" disabled>
                        <input type="text" class="form-control line4 right id" placeholder="" ng-model="addData.deptId" ng-show="popup=='单位修改'" disabled>
                    </div>
                    <div class="col-xs-6 lineH25">
                        <label class="left">单位名称：</label>
                        <input type="text" class="form-control line4 right unitname" placeholder="" ng-model="addData.deptName">
                    </div>
                </div>
                <br>
                <div class="row">
                    <div class="col-xs-6 lineH25">
                        <label class="left">单位等级：</label>
                        <select class="form-control grade line4 right" ng-model="addData.deptLevel" >
                            <option  value={{row.DICVALUE}} ng-repeat="row in listData1">{{row.DICVALUENAME}}</option>
                        </select>
                    </div>
                    <div class="col-xs-6 lineH25" ng-show="!(addData.deptLevel==1)">
                        <label class="left">上级单位：</label>
                        <select class="form-control line4 lineH25 right supunitname" ng-model="addData.parentId">
                            <option value="" ng-show="popup=='单位创建'">--请选择--</option>
                            <option value={{row.deptId}} ng-repeat="row in listData2">{{row.deptName}}</option>
                        </select>
                    </div>
                </div>
                <br>
                <div class="row">
                   <div class="col-xs-12">
                       <p><label>说明:</label></p>                     
                       <textarea class="form-control" ng-model="addData.remark"></textarea>
                   </div>
                    
                </div>
        <br>
    </div>
    <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
        <button type="button" class="btn btn-primary" ng-click='editSave()' >保存</button>
    </div>


</div>
</div>
</div>


 <div class="modal fade" id="delete">
                <div class="modal-dialog">
                    <div class="modal-content message_align">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
                            <h4 class="modal-title">提示信息</h4>
                        </div>
                        <div class="modal-body">
                            <p>您确认删除吗？</p>
                        </div>
                        <div class="modal-footer">
                            <input type="hidden" id="url"/>
                            <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                            <a  ng-click="deleteTr()" class="btn btn-primary" data-dismiss="modal" >确定</a>
                        </div>
                    </div><!-- /.modal-content -->
                </div><!-- /.modal-dialog -->
            </div><!-- /.modal -->
<!-- 加载框 -->
  <span class='loaded' ng-show='loaded'><img  src="img/load.gif"></span>
<!-- 加载框 完成-->